/*
 ------------------------------------------------------------------------------
 Copyright (C) 2009-2011 Eternal Games.

 This file is part of the Eternal Tech source code.

 The Eternal Tech source code is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or (at your
 option) any later version.

 The Eternal Tech source code is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 more details.

 You should have received a copy of the GNU General Public License along with
 the Eternal Tech source code; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 ------------------------------------------------------------------------------
*/


//
// shared.h - Main header file which should be included first by ALL program modules
//


#if !defined(__SHARED_H__) || !INCLUDE_GUARDS
#define __SHARED_H__


#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>


/*
 ==============================================================================

    WIN32 SPECIFICS

 ==============================================================================
*/

#ifdef _WIN32

#include <windows.h>
#include <intrin.h>

typedef __int64						longlong;
typedef unsigned __int64			ulonglong;

#define BUILD_STRING				"Win32-x86"

#endif

/*
 ==============================================================================

    SHARED TYPES AND DEFINES

 ==============================================================================
*/

typedef unsigned char				uchar;
typedef unsigned short				ushort;
typedef unsigned int				uint;
typedef unsigned long				ulong;

typedef uchar						byte;
typedef ushort						word;
typedef ulong						dword;
typedef ulonglong					qword;

typedef ushort						half;

#ifndef BIT
#define BIT(num)					(1 << (num))
#endif

#ifndef INCLUDE_GUARDS
#define INCLUDE_GUARDS				1
#endif

#ifdef INCLUDE_GUARDS
#define								CC_STR2(str) #str
#define 							CC_STR1(str) CC_STR2(str)
#define 							CC_LOC __FILE__ "("CC_STR1(__LINE__)") : warning: "

#if defined(_WIN32)
#define 							FILE_WARNING __pragma(message(CC_LOC"file included more than once!"))
#else
#define 							FILE_WARNING
#endif

#else
#define 							FILE_WARNING
#endif

/*
 ==============================================================================

    SHARED HEADERS

 ==============================================================================
*/

#include "string.h"

#include "math/math.h"
#include "math/color.h"
#include "math/vector.h"
#include "math/matrix.h"
#include "math/bounds.h"
#include "math/plane.h"

#include "fileFormats.h"

#include "../common/fileSystem.h"
#include "../common/memory.h"
#include "../common/cvarSystem.h"
#include "../common/parser.h"
#include "../common/editor.h"

#include "../win32/win_public.h"
#include "../renderer/r_public.h"
#include "../client/cl_public.h"
#include "../sound/s_public.h"


#else
FILE_WARNING
#endif   // __SHARED_H__